package org.jeecg.modules.demo.yxsofeiyongfentan.service.impl;

import org.jeecg.modules.demo.yxsofeiyongfentan.entity.SoInvoiceVo;
import org.jeecg.modules.demo.yxsofeiyongfentan.entity.SoFeiyVo;
import org.jeecg.modules.demo.yxsofeiyongfentan.entity.SoFTVo;
import org.jeecg.modules.demo.yxsofeiyongfentan.mapper.SoFeiyVoMapper;
import org.jeecg.modules.demo.yxsofeiyongfentan.mapper.SoFTVoMapper;
import org.jeecg.modules.demo.yxsofeiyongfentan.mapper.SoInvoiceVoMapper;
import org.jeecg.modules.demo.yxsofeiyongfentan.service.ISoInvoiceVoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: cw_sale_invoice
 * @Author: jeecg-boot
 * @Date:   2022-12-02
 * @Version: V1.0
 */
@Service
public class SoInvoiceVoServiceImpl extends ServiceImpl<SoInvoiceVoMapper, SoInvoiceVo> implements ISoInvoiceVoService {

	@Autowired
	private SoInvoiceVoMapper soInvoiceVoMapper;
	@Autowired
	private SoFeiyVoMapper soFeiyVoMapper;
	@Autowired
	private SoFTVoMapper soFTVoMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		soFeiyVoMapper.deleteByMainId(id);
		soFTVoMapper.deleteByMainId(id);
		soInvoiceVoMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			soFeiyVoMapper.deleteByMainId(id.toString());
			soFTVoMapper.deleteByMainId(id.toString());
			soInvoiceVoMapper.deleteById(id);
		}
	}
	
}
